package com.jumi.microservice.service;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jumi.microservice.dto.reponse.SalesReponse;
import com.jumi.microservice.dto.reponse.api.SelfShopResponse;
import com.jumi.microservice.entity.CommonGroup;
import com.jumi.microservice.entity.JmUserSales;
import com.baomidou.mybatisplus.extension.service.IService;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 用户业绩表 服务类
 * </p>
 *
 * @author 要挑客户管理团队
 * @since 2020-07-14
 */
public interface IJmUserSalesService extends IService<JmUserSales> , PageService {

    /**
     * 获得总业绩金额
     * @param wrapper
     * @return
     */
    BigDecimal getSumSales(QueryWrapper wrapper);



    Page getSalesByInviterId(Page page,Integer inviterId,QueryWrapper wrapper);

    /**
     * 获得总订单数量
     * @param wrapper
     * @return
     */
    Integer getSumOrderNum(Wrapper wrapper);

    /**
     * 获得自购已省金额
     * @return
     */
    BigDecimal getSelfMoney(QueryWrapper wrapper);

    /**
     * 获得自购省列表
     * @return
     */
    Page<SelfShopResponse> getSelfPage(Page page,QueryWrapper wrapper);


    /**
     * 获取不同消费类型的业绩
     * @return
     */
    List<CommonGroup> getSumSalesByConsumerType(QueryWrapper wrapper);
}
